<template>
    <div v-transfer-dom>
        <popup v-model="propShow"
               width="100%"
               @on-hide="propHide">
            <div class="content-wrap">
                <div class="demo2">
                    <div class="demo2_main">
                        <noData v-if="arr1 == 0"></noData>
                        <div class="list1Box">
                            <group>
                                <radio :options="arr1"
                                       @on-change="change"
                                       v-model="radios"></radio>
                            </group>
                        </div>
                    </div>
                </div>
            </div>
        </popup>
    </div>
</template>
<script>
import { TransferDom, Popup, Icon, Radio } from 'vux'
export default {
    name: 'provinceProp',
    data () {
        return {
            propShow: false,
            userInfo: '',
            show: false,
            arr1: [],
            arr2: [],
            radios: '全部',
            parmas: {
                userId: ''
            }
        }
    },
    components: {
        Popup,
        Icon,
        Radio
    },
    directives: {
        TransferDom
    },
    props: {
        selectProvince: {
            type: Function
        },
        ProvincePropShow: {
            type: Boolean,
            default: false
        }
    },
    watch: {
        ProvincePropShow (newVal) {
            this.propShow = newVal
        }
    },
    created () {
        var token = JSON.parse(window.localStorage.getItem('userInfo'))
        this.parmas.userId = token.userid
        this.getArealist()
    },
    methods: {
        propHide () {
            this.$parent.ProvincePropShow = false
        },
        change (value, label) {
            this.selectProvince(value)
        },
        getArealist () {
            let param = {
                allowPaging: true,
                business: 'GetLawAreas',
                data: {},
                pageIndex: 0,
                pageSize: 0,
                tokenId: '',
                userId: this.parmas.userId
            }
            this.$axiosAjax.getConfigJson(param).then(res => {
                res.data.data.forEach((item, index) => {
                    this.arr1.push(item.Text)
                })
            })
        }
    }
}
</script>
<style scoped>
header {
    line-height: 40px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.1);
}
header .search-wrap {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #666;
    height: 36px;
    border-radius: 18px;
    padding-left: 18px;
}
header input {
    flex: 1;
    height: 34px;
}
header button {
    width: 34px;
    height: 34px;
    background: url(../../../static/images/s_03.png) no-repeat center;
    background-size: 28px 28px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 10px;
}
.content-wrap {
    height: 100%;
    overflow-y: scroll;
}
li {
    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
</style>
